package com.qingsong.dto;

import com.qingsong.constant.RE;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import javax.validation.constraints.Size;
import java.io.Serializable;
import java.time.LocalDateTime;

/** @author qingsong */
@Schema(name = "优惠卷修改DTO")
@Data
public class CouponsUpdateDTO implements Serializable, RE {

    @NotNull(message = "优惠卷主键不能为空")
    @Schema(description = "主键")
    private Long id;

    @Size(min = 1, max = 42, message = "标题长度必须在1~42之间")
    @Schema(description = "代码")
    private String code;

    @Size(min = 1, max = 42, message = "标题长度必须在1~42之间")
    @Schema(description = "标题")
    private String title;

    @Pattern(regexp = INFO_RE, message = INFO_RE_MSG)
    @Schema(description = "信息")
    private Double cpPrice;

    @Pattern(regexp = INFO_RE, message = INFO_RE_MSG)
    @Schema(description = "信息")
    private String info;

    @Schema(description = "生效时间")
    private LocalDateTime startTime;

    @Schema(description = "失效时间")
    private LocalDateTime endTime;
}
